<template>
<div>
    <el-form-item :label="formItem.title">
        <picker-view v-if="formItem.type == 'select'" type="store" :ruleForm="ruleForm" :field="formItem.field"></picker-view>
        <el-date-picker v-else-if="formItem.type == 'date'" v-model="ruleForm[formItem.field]" type="date" value-format="yyyy-MM-dd" :placeholder="formItem.placeholder || '选择日期'"></el-date-picker>
        <el-date-picker v-else-if="formItem.type == 'date_range'" v-model="ruleForm[formItem.field]" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
        <el-input v-else-if="formItem.type == 'textarea'" type="textarea" v-model="ruleForm[formItem.field]" :autosize="{ minRows: 2, maxRows: 4}" :placeholder="formItem.placeholder"></el-input>
        <el-input v-else v-model="ruleForm[formItem.field]" :placeholder="formItem.placeholder || '请输入'"></el-input>
    </el-form-item>
</div>
</template>

<script>
import pickerView from '../picker/index.vue'

export default {
    props: {
        ruleForm: {},
        formItem: {}
    },
    components: {
        pickerView
    },

}
</script>
